import { service as request, serviceModel as requestModel } from '@/utils/request_web'

export function getTashList(owner) {
  return request({
    url: `/Work/Task/`,
    method: 'get',
    params: owner
  })
}
export function getTaskClassify(params) {
  return request({
    url: `/Work/TaskClassify/`,
    method: 'get',
    params
  })
}
// 查询任务信息 id
export function getTaskInfo(id) {
  return request({
    url: `/Work/Task/${id}/`,
    method: 'get'
  })
}
// 查询待办任务信息
export function getPendingTaskInfo(user, finish) {
  return request({
    url: `/Work/Task/?user=${user}&is_publish=1&is_finish=${finish}&finish_approval=1`,
    method: 'get'
  })
}
// 修改发布状态 id
export function updateTaskPart(id, data) {
  return request({
    url: `/Work/Task/${id}/`,
    method: 'patch',
    data: data
  })
}
// 删除任务信息 id
export function delTask(id) {
  return request({
    url: `/Work/Task/${id}/`,
    method: 'delete'
  })
}

// 删除已上传文件 id
export function delHasFile(id) {
  return request({
    url: `/Work/Files/${id}/`,
    method: 'delete'
  })
}
// 查看已上传文件记录
export function getFileInfoById(id) {
  return request({
    url: `/Work/Files/${id}/`,
    method: 'get'
  })
}
// 查看已上传文件记录
export function getHistoryUpFile(params) {
  return request({
    url: `/Work/Files/`,
    method: 'get',
    params
  })
}
// 获取数据统计信息
export function getStatistFile(task) {
  return request({
    url: `/Work/statistFile/`,
    method: 'get',
    params: { task }
  })
}

// 查询指标体系
export function getIndexList(data) {
  return request({
    url: `/Work/Target/`,
    method: 'get',
    params: data
  })
}
// 查询指标 id
export function getIndexByid(id) {
  return request({
    url: `/Work/Target/${id}`,
    method: 'get'
  })
}
// 创建指标
export function createIndex(data) {
  return request({
    url: `/Work/Target/`,
    method: 'post',
    data: data
  })
}
// 修改指标
export function patchIndex(id, data) {
  return request({
    url: `/Work/Target/${id}/`,
    method: 'patch',
    data: data
  })
}
// 删除指标
export function deleteTarget(id) {
  return request({
    url: `/Work/Target/${id}/`,
    method: 'delete'
  })
}
// 痕迹点评
export function postMarkComent(data) {
  return request({
    url: `/Work/MarkComent/`,
    method: 'post',
    data: data
  })
}
// 痕迹点评记录
export function getMarkComents(id) {
  return request({
    url: `/Work/MarkComent/?mark=${id}`,
    method: 'get'
  })
}
//删除痕迹
export function deleteTrace(id) {
  return request({
    url:`/Work/Mark/${id}/ `,
    method:'delete'
  })
} 
//删除痕迹点评
export function deleteTracePonit(id){
  return request({
    url:`/Work/MarkComent/${id}/`,
    method:'delete'
  })
}
// 查询指标详细信息
export function getDetailIndex(id) {
  return request({
    url: `/Work/TargetDetail/${id}/`,
    method: 'get'
  })
}
// 编辑页面 创建一级指标
export function createDetailIndex(data) {
  return request({
    url: `/Work/TargetDetail/`,
    method: 'post',
    data: data
  })
}
// 修改指标
export function updateDetailIndex(id, data) {
  return request({
    url: `/Work/TargetDetail/${id}/`,
    method: 'patch',
    data: data
  })
}
// 删除指标
export function deleteDetailIndex(id) {
  return request({
    url: `/Work/TargetDetail/${id}/`,
    method: 'delete'
  })
}
// h获取模型列表
export function getModels() {
  return requestModel({
    url: `/models`,
    method: 'get'
  })
}
// 通过指标查看痕迹
export function getMarkInfo(targetdetail) {
  return request({
    url: `/Work/Mark/`,
    method: 'get',
    params: { targetdetail }
  })
}
// 删除痕迹
export function deleteMarkInfo(id) {
  return request({
    url: `/Work/Mark/${id}/`,
    method: 'delete'
  })
}
// 普通创建任务
export function postCreateTask(data) {
  return request({
    url: `/Work/Task/`,
    method: 'post',
    data
  })
}

// 处理签发文字号列表
export function getTaskPubWord() {
  return request({
    url: `/Work/issusedfy/`,
    method: 'get'
  })
}
// 获取套红模板
export function getPaperClassify(id) {
  return request({
    url: `/Work/PaperClassify/` + id,
    method: 'get'
  })
}
// 请求推送上报
export function postPushReport(data) {
  return request({
    url: `/Work/super_report/`,
    method: 'post',
    data
  })
}
// 任务上报进度监控
export function getTaskProcessMonitor(taskId, userId) {
  return request({
    url: `/Work/data_monitoring/?taskid=${taskId}&userid=${userId}`,
    method: 'get'
  })
}
// 版本信息
export function getCopyRight() {
  return request({
    url: `/Work/systemversion/`,
    method: 'get'
  })
}
// 上传文件点评
export function postFileComment(data) {
  return request({
    url: `/Work/FileComment/`,
    method: 'post',
    data: data
  })
}
// 上传文件点评记录
export function getFileComments(id) {
  return request({
    url: `/Work/FileComment/?file=${id}`,
    method: 'get'
  })
}
// 创建数据上报审批任务
export function createUploadApprovalTask(data) {
  return request({
    url: `/Work/workreport/`,
    method: 'post',
    data
  })
}
// 数据上报审批上传记录
export function getUploadApprovalFileHistory(params) {
  return request({
    url: `/Work/workreport/`,
    method: 'get',
    params
  })
}
// 删除上报审批上传记录
export function deleteUploadApprovalFileHistory(id) {
  return request({
    url: `/Work/workreport/${id}/`,
    method: 'delete'
  })
}
// 获取数据上报任务信息
export function getUploadApprovalTaskInfo(id) {
  return request({
    url: `/Work/workreport/${id}/`,
    method: 'get'
  })
}
// 创建公务用车审批任务
export function createUseCarApprovalTask(data) {
  return request({
    url: `/Question/approval_gwyc/`,
    method: 'post',
    data
  })
}
// 获取公务用车审批任务记录
export function getUseCarApprovalTaskHistory(params) {
  return request({
    url: `/Question/approval_gwyc/`,
    params
  })
}
// 获取公务用车审批任务信息
export function getUseCarApprovalTaskInfo(id) {
  return request({
    url: `/Question/approval_gwyc/${id}/`,
    method: 'get'
  })
}
// 修改公务用车审批状态
export function updateUseCarApprovalTask(id, data) {
  return request({
    url: `/Question/approval_gwyc/${id}/`,
    method: 'patch',
    data
  })
}
// 删除公务用车审批上传记录
export function deleteUseCarApprovalTaskHistory(id) {
  return request({
    url: `/Question/approval_gwyc/${id}/`,
    method: 'delete'
  })
}

// 创建办公用品采购审批任务
export function createOfficeBuyApprovalTask(data) {
  return request({
    url: `/Question/approval_ypcg_sp/`,
    method: 'post',
    data
  })
}
// 获取办公用品采购审批任务记录
export function getOfficeBuyApprovalTaskHistory(params) {
  return request({
    url: `/Question/approval_ypcg/`,
    params
  })
}
// 通过ID获取办公用品采购审批任务信息
export function getOfficeBuyApprovalTaskInfo(id) {
  return request({
    url: `/Question/approval_ypcg/${id}/`
  })
}
// 修改办公用品采购审批状态
export function updateOfficeBuyApprovalTask(id, data) {
  return request({
    url: `/Question/approval_ypcg/${id}/`,
    method: 'patch',
    data
  })
}
// 删除办公用品采购审批任务信息
export function deleteOfficeBuyApprovalTaskInfo(id) {
  return request({
    url: `/Question/approval_ypcg/${id}/`,
    method: 'delete'
  })
}



// 创建请假审批任务
export function createHolidayApprovalTask(data) {
  return request({
    url: `/Question/approval_leave/`,
    method: 'post',
    data
  })
}
// 获取请假审批任务记录
export function getHolidayApprovalTaskHistory(params) {
  return request({
    url: `/Question/approval_leave/`,
    params
  })
}
// 获取请假审批任务信息
export function getHolidayApprovalTaskInfo(id) {
  return request({
    url: `/Question/approval_leave/${id}/`,
    method: 'get'
  })
}
// 修改请假审批状态
export function updateHolidayApprovalTask(id, data) {
  return request({
    url: `/Question/approval_leave/${id}/`,
    method: 'patch',
    data
  })
}
// 删除请假审批上传记录
export function deleteHolidayApprovalTaskHistory(id) {
  return request({
    url: `/Question/approval_leave/${id}/`,
    method: 'delete'
  })
}
/**
 * 通知类任务反馈
 */
// 提交反馈
export function postNoticeTaskFeedback(data) {
  return request({
    url: `/Work/notice_status/`,
    method: 'post',
    data
  })
}
//删除点评历史
export function deleteHistory(id){
  return request({
    url:`/Work/FileComment/${id}/`,
    method:'delete'
  })
}

//获取请假历史记录
export function getWittenHistoryRecord(params){
  return request({
    url:'/User/userleave/',
    method:'get',
    params,
  })
}